package com.todo.strategy.pipeline.infrastructure.repository;

import com.todo.strategy.pipeline.common.enums.ExecuteStatusEnum;
import com.todo.strategy.pipeline.common.enums.StrategyActionEnum;
import com.todo.strategy.pipeline.infrastructure.entity.po.PipelineRecordPO;

import java.util.Date;
import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/2/28 20:54
 * @description
 */
public interface PipelineRecordRepository {
    /**
     * 根据唯一键查询流水记录
     *
     * @param uniKey
     * @param actionType
     * @return
     */
    PipelineRecordPO queryPipelineRecordByUniKey(String uniKey, StrategyActionEnum actionType);

    /**
     * 新增流水记录
     *
     * @param pipelineRecordPO
     * @return
     */
    boolean insertPipelineRecord(PipelineRecordPO pipelineRecordPO);

    /**
     * 更新流水记录
     *
     * @param pipelineRecordPO
     * @return
     */
    boolean updatePipelineRecord(PipelineRecordPO pipelineRecordPO);

    /**
     * 根据时间范围查询流水记录
     *
     * @param actionType
     * @param status
     * @param startTime
     * @param endTime
     * @return
     */
    List<PipelineRecordPO> queryPipelineRecordByTimeRange(StrategyActionEnum actionType, ExecuteStatusEnum status, Date startTime, Date endTime);
}
